package cn.enjoy.rocketmq.consumer;

import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @author K
 * @date 2021/6/3 下午3:40
 */
@Component
@RocketMQMessageListener(
        topic = "boot",
        selectorExpression = "TagTest",
        consumerGroup = "CommonConsumerGroup",
        messageModel = MessageModel.CLUSTERING
)
public class ConsumerCommon implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        System.out.println(String.format("当前线程：%s \t收到的消息（TagTest）：%s", Thread.currentThread().getName(), message));
    }

}

